package com.springdemo.user.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.springdemo.entity.UserEntity;
import com.springdemo.user.dao.UserDao;
import com.springdemo.user.service.UserService;
import com.springdemo.util.GenerateId;

@Service
public class UserServiceImpl implements UserService{

	@Autowired
	UserDao userDao;
	
	@Override
	public int deleteUserById(String userId) {
		return userDao.deleteUserById(userId);
	}

	@Override
	public int insert(UserEntity user) {
		user.setUserId(GenerateId.getUUID());
		return userDao.insert(user);
	}

	@Override
	public UserEntity findUserById(String userId) {
		return userDao.findUserById(userId);
	}

	@Override
	public int updateById(UserEntity user) {
		return userDao.updateById(user);
	}

	@Override
	public List<UserEntity> findUserByCondition(UserEntity user) {
		return userDao.findUserByCondition(user);
	}

}
